/*
 * BaseWindow.java
 *
 * Created on March 1, 2009, 10:13 PM
 */

package net.sf.bluex.boundary;

import net.sf.bluex.components.SystemIconPopupMenu;
import net.sf.bluex.plugin.Plugin;
import net.sf.bluex.plugin.PluginMetaData;
import net.sf.bluex.controller.FileModule;
import net.sf.bluex.controller.UsefulMethods;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.Vector;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import net.sf.bluex.components.HelpMapper;
import net.sf.bluex.components.Info;
import net.sf.bluex.components.InfoIcon;
import net.sf.bluex.components.Updater;
import net.sf.bluex.controller.BaseWindowManagement;
import net.sf.bluex.exceptionManager.ErrorIcon;
import net.sf.bluex.exceptionManager.ExceptionManager;
import net.sf.bluex.explorer.boundary.Explorer;
import net.sf.bluex.explorer.boundary.SearchDialog;
import net.sf.bluex.explorer.components.FilePopUpMenu;
import net.sf.bluex.plugin.ModuleDetail;
import net.sf.bluex.threads.InterruptableThread;

/**
 *
 * @author  Blue
 */
public class BaseWindow extends javax.swing.JFrame {

    private JLabel lbFileCounts;
    private Explorer exp;
    
    /**************************
     ***** STATIC MEMBERS *****
     **************************/
    public static final String VERSION="3.0.0 Beta";
    
    public static final String ACTIVE_PARTICIPATION="<html><body>This is an open source software. Anyone can be a part of developement.<br/>" +
            "If you want to be a part of its developement please mail me.<br/>" +
            "Emails: <br/><br/>" +
            "eighty_coffee@yahoo.com<br/>pratikabu@gmail.com<br/><br/></body></html>";
    
    public static final String ABOUT="<html><body><b><font color=\"#999999\">Blue</font><font color=\"#0066FF\">X</font></b><br/>Version "+VERSION+".<br/>Explorer with autmated scanning.<br/>" +
            "By Eighty_Coffee<br/><br/>" +
            "This is not an antivirus tool. So please install antivirus for network viruses attacks.<br/><br/>"+
            "This tool do not remove viruses from infected pcs. So better for 100% security<br/>format you pc and then use it for every pendrive or stuffs.</body></html>";

    /************************
     ***** CONSTRUCTORS *****
     ************************/
    public BaseWindow(java.io.File parentFile) {
        initComponents();
        initPluginsMenu();

        jToolBar1.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
        jToolBar2.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 2));
        jToolBar2.add(InfoIcon.getInfoIcon());
        jToolBar2.add(ErrorIcon.getErrorIcon());
        lbFileCounts=new JLabel("N/A");
        jToolBar2.add(lbFileCounts);
        JLabel lb1=new JLabel(UsefulMethods.getIcon("local.gif"));
        lb1.setToolTipText("Local File System.");
        jToolBar2.add(lb1);

        //load the explorer
        exp=new Explorer(this);
        exp.goToURI(parentFile);
        pCenter.add(exp,BorderLayout.CENTER);

        initIcons();

        this.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent we){
                doClosingJob();
            }
        });
        this.setIconImage(UsefulMethods.getImage(FileModule.APP_ICON));
        this.setBounds(50, 50, 870, 630);
        this.setLocationRelativeTo(null);

        this.jProgressBar1.setVisible(false);

        BaseWindowManagement.registerBaseWindow(this);
        setVisible(true);
    }

    private void doClosingJob() {
        BaseWindowManagement.deregisterBaseWindow(this);
        this.dispose();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pCenter = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        jProgressBar1 = new javax.swing.JProgressBar();
        jToolBar2 = new javax.swing.JToolBar();
        jSeparator6 = new javax.swing.JSeparator();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnFile = new javax.swing.JMenu();
        jSeparator8 = new javax.swing.JSeparator();
        jSeparator3 = new javax.swing.JSeparator();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenuItem12 = new javax.swing.JMenuItem();
        jSeparator7 = new javax.swing.JSeparator();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem9 = new javax.swing.JMenuItem();
        jSeparator9 = new javax.swing.JSeparator();
        jMenuItem10 = new javax.swing.JMenuItem();
        mnTools = new javax.swing.JMenu();
        mnFileTypeAssociations = new javax.swing.JMenuItem();
        mnThreadMonitor = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem11 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        mnOptions = new javax.swing.JMenuItem();
        mnPlugins = new javax.swing.JMenu();
        mnManagePlugins = new javax.swing.JMenuItem();
        jSeparator4 = new javax.swing.JSeparator();
        mnHelp = new javax.swing.JMenu();
        mnhHelpTopics = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jSeparator5 = new javax.swing.JSeparator();
        jMenuItem2 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        mnhAboutSystem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("BlueX- Eighty_Coffee");

        pCenter.setBackground(new java.awt.Color(153, 153, 153));
        pCenter.setLayout(new java.awt.BorderLayout());
        getContentPane().add(pCenter, java.awt.BorderLayout.CENTER);

        jPanel1.setLayout(new java.awt.BorderLayout());

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        jProgressBar1.setIndeterminate(true);
        jProgressBar1.setString("Fetching Data");
        jProgressBar1.setStringPainted(true);
        jToolBar1.add(jProgressBar1);

        jPanel1.add(jToolBar1, java.awt.BorderLayout.LINE_START);

        jToolBar2.setFloatable(false);
        jToolBar2.setRollover(true);
        jPanel1.add(jToolBar2, java.awt.BorderLayout.CENTER);
        jPanel1.add(jSeparator6, java.awt.BorderLayout.PAGE_START);

        getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_END);

        mnFile.setMnemonic('F');
        mnFile.setText("File");
        mnFile.addMenuListener(new javax.swing.event.MenuListener() {
            public void menuCanceled(javax.swing.event.MenuEvent evt) {
            }
            public void menuDeselected(javax.swing.event.MenuEvent evt) {
            }
            public void menuSelected(javax.swing.event.MenuEvent evt) {
                mnFileMenuSelected(evt);
            }
        });
        mnFile.add(jSeparator8);
        mnFile.add(jSeparator3);

        jMenuBar1.add(mnFile);

        jMenu1.setMnemonic('E');
        jMenu1.setText("Edit");

        jMenuItem6.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem6.setMnemonic('C');
        jMenuItem6.setText("Copy Selected");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem6);

        jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem7.setMnemonic('P');
        jMenuItem7.setText("Paste");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem7);

        jMenuItem12.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_DELETE, 0));
        jMenuItem12.setMnemonic('D');
        jMenuItem12.setText("Delete");
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem12);
        jMenu1.add(jSeparator7);

        jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem8.setMnemonic('A');
        jMenuItem8.setText("Select All");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem8);

        jMenuItem9.setMnemonic('I');
        jMenuItem9.setText("Invert Selection");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem9);
        jMenu1.add(jSeparator9);

        jMenuItem10.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem10.setMnemonic('S');
        jMenuItem10.setText("Search Current Location");
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem10ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem10);

        jMenuBar1.add(jMenu1);

        mnTools.setMnemonic('T');
        mnTools.setText("Tools");

        mnFileTypeAssociations.setMnemonic('F');
        mnFileTypeAssociations.setText("File Type Associations");
        mnFileTypeAssociations.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnFileTypeAssociationsActionPerformed(evt);
            }
        });
        mnTools.add(mnFileTypeAssociations);

        mnThreadMonitor.setMnemonic('T');
        mnThreadMonitor.setText("Threads Monitor");
        mnThreadMonitor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnThreadMonitorActionPerformed(evt);
            }
        });
        mnTools.add(mnThreadMonitor);

        jMenuItem1.setText("Exception Manager");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        mnTools.add(jMenuItem1);

        jMenuItem11.setText("Free up Memory");
        jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem11ActionPerformed(evt);
            }
        });
        mnTools.add(jMenuItem11);
        mnTools.add(jSeparator2);

        mnOptions.setMnemonic('O');
        mnOptions.setText("Options");
        mnOptions.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnOptionsActionPerformed(evt);
            }
        });
        mnTools.add(mnOptions);

        jMenuBar1.add(mnTools);

        mnPlugins.setMnemonic('P');
        mnPlugins.setText("Plug-ins");

        mnManagePlugins.setMnemonic('M');
        mnManagePlugins.setText("Plugins Manager");
        mnManagePlugins.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnManagePluginsActionPerformed(evt);
            }
        });
        mnPlugins.add(mnManagePlugins);
        mnPlugins.add(jSeparator4);

        jMenuBar1.add(mnPlugins);

        mnHelp.setMnemonic('H');
        mnHelp.setText("Help");

        mnhHelpTopics.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        mnhHelpTopics.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/sf/bluex/resources/question.gif"))); // NOI18N
        mnhHelpTopics.setText("Help Center");
        mnhHelpTopics.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnhHelpTopicsActionPerformed(evt);
            }
        });
        mnHelp.add(mnhHelpTopics);

        jMenuItem3.setText("Visit BlueX Home Page");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        mnHelp.add(jMenuItem3);

        jMenuItem5.setText("BlueX disscussion forum");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        mnHelp.add(jMenuItem5);

        jMenuItem4.setText("Visit Eighty_Coffee Home Page");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        mnHelp.add(jMenuItem4);
        mnHelp.add(jSeparator5);

        jMenuItem2.setText("Check for Updates...");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        mnHelp.add(jMenuItem2);
        mnHelp.add(jSeparator1);

        mnhAboutSystem.setMnemonic('A');
        mnhAboutSystem.setText("About BlueX");
        mnhAboutSystem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnhAboutSystemActionPerformed(evt);
            }
        });
        mnHelp.add(mnhAboutSystem);

        jMenuBar1.add(mnHelp);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void initPluginsMenu() {
        Vector<PluginMetaData> vectPMD=UsefulMethods.getAllInstalledPlugins(ModuleDetail.NEW_WINDOW_PLUGIN);
        
        if(vectPMD!=null)
            for(final PluginMetaData pmd : vectPMD){
                JMenuItem jmi=new JMenuItem(pmd.getName());
                jmi.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        try{
                            Plugin pg=UsefulMethods.getSelectedPlugin(pmd);
                            pg.openNewWindowPlugin(null);
                        }catch(Exception ex){
                            JOptionPane.showMessageDialog(BaseWindow.this, "Cannot open the selected Plugin.");
                        }
                    }
                });

                mnPlugins.add(jmi);
            }
    }

private void mnhAboutSystemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnhAboutSystemActionPerformed
// TODO add your handling code here:
    AboutBlueX.showAboutDialog(this);
}//GEN-LAST:event_mnhAboutSystemActionPerformed

private void mnOptionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnOptionsActionPerformed
    // TODO add your handling code here:
    Options.showOptions(this);
}//GEN-LAST:event_mnOptionsActionPerformed

private void mnManagePluginsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnManagePluginsActionPerformed
    // TODO add your handling code here:
        PluginManager.showPluginManager();
}//GEN-LAST:event_mnManagePluginsActionPerformed

private void mnFileTypeAssociationsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnFileTypeAssociationsActionPerformed
    // TODO add your handling code here:
    FileTypeAssociationManager.showFileTypeDialog(this);
}//GEN-LAST:event_mnFileTypeAssociationsActionPerformed

private void mnThreadMonitorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnThreadMonitorActionPerformed
    // TODO add your handling code here:
    ThreadsMonitor.showRunningThreads(null);
}//GEN-LAST:event_mnThreadMonitorActionPerformed

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
    // TODO add your handling code here:
    ExceptionManager.showExceptionManager();
}//GEN-LAST:event_jMenuItem1ActionPerformed

private void mnhHelpTopicsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnhHelpTopicsActionPerformed
    // TODO add your handling code here:
    HelpMapper.showHelpHome();
}//GEN-LAST:event_mnhHelpTopicsActionPerformed

private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
    // TODO add your handling code here:
    UsefulMethods.openHomePageinBrowser();
}//GEN-LAST:event_jMenuItem4ActionPerformed

private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
    // TODO add your handling code here:
    newComponents.components.UsefulMethods.openPageInBrowser("http://sourceforge.net/projects/bluex");
}//GEN-LAST:event_jMenuItem5ActionPerformed

private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
    // TODO add your handling code here:
    newComponents.components.UsefulMethods.openPageInBrowser("http://bluex.sourceforge.net");
}//GEN-LAST:event_jMenuItem3ActionPerformed

private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
    // TODO add your handling code here:
    exp.getAV().copy();
}//GEN-LAST:event_jMenuItem6ActionPerformed

private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
    // TODO add your handling code here:
    exp.getAV().paste();
}//GEN-LAST:event_jMenuItem7ActionPerformed

private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
    // TODO add your handling code here:
    exp.getAV().selectAll();
}//GEN-LAST:event_jMenuItem8ActionPerformed

private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
    // TODO add your handling code here:
    exp.getAV().invertSelection();
}//GEN-LAST:event_jMenuItem9ActionPerformed

private void mnFileMenuSelected(javax.swing.event.MenuEvent evt) {//GEN-FIRST:event_mnFileMenuSelected
    // TODO add your handling code here:
    mnFile.removeAll();


    for(Component cmp : FilePopUpMenu.getComponentsAdded(exp.getAV()))
        mnFile.add(cmp);

    mnFile.add(jSeparator8);

    JMenuItem mnNewInstance=new JMenuItem();
    mnNewInstance.setMnemonic('O');
    mnNewInstance.setText("Open Another Instance");
    mnNewInstance.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            new BaseWindow(null);
        }
    });
    mnFile.add(mnNewInstance);

    JMenuItem mnClose=new JMenuItem();
    mnClose.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
    mnClose.setMnemonic('C');
    mnClose.setText("Close Instance");
    mnClose.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            doClosingJob();
        }
    });
    mnFile.add(mnClose);
    mnFile.add(jSeparator3);

    JMenuItem mnExit=new JMenuItem();
    mnExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
    mnExit.setMnemonic('x');
    mnExit.setText("Exit System");
    mnExit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            SystemIconPopupMenu.exit();
        }
    });
    mnFile.add(mnExit);
}//GEN-LAST:event_mnFileMenuSelected

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
    // TODO add your handling code here:
    new Updater().refreshDownloadedData();
}//GEN-LAST:event_jMenuItem2ActionPerformed

private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
    // TODO add your handling code here:
    SearchDialog.openSearchBoxFor(exp.getAV().getCurrentURI());
}//GEN-LAST:event_jMenuItem10ActionPerformed

private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
    // TODO add your handling code here:
    InterruptableThread t = InterruptableThread.getMyThread(new Runnable() {

        public void run() {
            System.gc();
            InfoIcon.info(new Info("Freeing up process completed.", "Java Virtual Machine has made a best effort to reclaim space " +
                    "from all discarded objects."));
        }
    }, "Memory Freeing Thread");
    t.start();
}//GEN-LAST:event_jMenuItem11ActionPerformed

private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
    getExplorer().getAV().delete();
}//GEN-LAST:event_jMenuItem12ActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JSeparator jSeparator8;
    private javax.swing.JSeparator jSeparator9;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JMenu mnFile;
    private javax.swing.JMenuItem mnFileTypeAssociations;
    private javax.swing.JMenu mnHelp;
    private javax.swing.JMenuItem mnManagePlugins;
    private javax.swing.JMenuItem mnOptions;
    private javax.swing.JMenu mnPlugins;
    private javax.swing.JMenuItem mnThreadMonitor;
    private javax.swing.JMenu mnTools;
    private javax.swing.JMenuItem mnhAboutSystem;
    private javax.swing.JMenuItem mnhHelpTopics;
    private javax.swing.JPanel pCenter;
    // End of variables declaration//GEN-END:variables

    public void setFileCount(int notHidden, int hiddens){
        String fileCounts=notHidden+" objects";
        if(hiddens!=0)
            fileCounts+=" (plus "+hiddens+" hiddens)";

        this.lbFileCounts.setText(fileCounts);
    }

    public void setLoadingBar(boolean show){
        this.jProgressBar1.setVisible(show);
    }

    public void setLoadingText(String text){
        this.jProgressBar1.setString(text);
    }

    public Explorer getExplorer() {
        return exp;
    }

    public void dataUpdated(File[] files, int updationType){
        BaseWindowManagement.dataUpdated(files, this, updationType);
    }

    private void initIcons() {
        jMenuItem6.setIcon(UsefulMethods.getIconFromIconSet("copy.gif", 2));
        jMenuItem7.setIcon(UsefulMethods.getIconFromIconSet("paste.gif", 2));
        jMenuItem12.setIcon(UsefulMethods.getIconFromIconSet("delete.gif", 2));
        jMenuItem10.setIcon(UsefulMethods.getIconFromIconSet("search.gif", 2));
    }
}
